import 'package:flutter/material.dart';
//装饰容器DecoratedBox

class DecoratedBoxRote extends StatefulWidget {
  @override
  _DecoratedBoxRoteState createState() => _DecoratedBoxRoteState();
}

class _DecoratedBoxRoteState extends State<DecoratedBoxRote> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("装饰容器DecoratedBox"),
      ),
      body: _DecoratedBoxRoteBody(),
    );
  }
}

class _DecoratedBoxRoteBody extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DecoratedBox(
      decoration: BoxDecoration(
        gradient:
            LinearGradient(colors: [Colors.orange[600],Colors.red, Colors.orange[700]]), //背景渐变
        borderRadius: BorderRadius.circular(3.0), //圆角
        boxShadow: [
          BoxShadow(
              color: Colors.black54, offset: Offset(2.0, 2.0), blurRadius: 4.0)
        ], //阴影
      ),
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 80.0, vertical: 18.0),
        child: Text(
          "login",
          style: TextStyle(color: Colors.white),
        ),
      ),
    );
  }
}
